package io.github.wanggit.antrpc.console.service.dto;

import java.io.Serializable;
import java.util.Objects;

public class AppRelNodeDTO implements Serializable {

    private static final long serialVersionUID = -274516696718998791L;

    private String from;

    private String to;

    public AppRelNodeDTO(String from, String to) {
        this.from = from;
        this.to = to;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    @Override
    public int hashCode() {
        return from.hashCode() + to.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof AppRelNodeDTO)) {
            return false;
        }
        AppRelNodeDTO other = (AppRelNodeDTO) obj;
        return Objects.equals(from, other.getFrom()) && Objects.equals(to, other.getTo());
    }
}
